<!DOCTYPE html>
<html lang="en" ng-app="app" ng-controller="appCtrl">

<head>
    <meta charset="UTF-8">
    <title>测试级联下拉框</title>
    <link rel="stylesheet" type="text/css" href="../bootstrap-3.3.4/css/bootstrap.css">
    <script src="angular.min.js"></script>
</head>

<body>
    <div class="container">

        <form action="" class="form-inline">
            <div class="form-group">
                <label for="" class="">级联</label>
                
                    <select class="selectedEx" class="form-control" ng-model="selectedEx" ng-change="selectedExChn1=''" ng-options="obj.key for obj in ex">
                        <option value="">---请选择考区---</option>
                    </select>
                    <select class="form-control" ng-model="selectedExChn1" ng-change="selectedExChn2=''" ng-options="obj.key for obj in selectedEx.children" ng-if="selectedEx.children">
                        <option value="">---请选择单位---</option>
                    </select>




                    --
                    {{selectedEx.value}}
                
            </div>

        </form>    			

    </div>
    <script>
    /**
     *  Module
     *
     * Description
     */
    var app = angular.module('app', []);
    app.controller('appCtrl', ['$scope', function($scope) {
        $scope.ex = [{
            "value": "99",
            "key": "省直",
            "children": [{
                "value": "9901",
                "key": "省单位1",
                "children": [{
                    "value": "990101",
                    "key": "省职位1"
                }, {
                    "value": "990102",
                    "key": "省职位2"
                }]
            }, {
                "value": "9902",
                "key": "省单位2",
                "children": [{
                    "value": "990201",
                    "key": "省职位3"
                }, {
                    "value": "990202",
                    "key": "省职位4"
                }]
            }]
        }, {
            "value": "01",
            "key": "长沙",
            "children": [{
                "value": "0101",
                "key": "长沙单位1",
                "children": [{
                    "value": "010101",
                    "key": "长沙职位1"
                }, {
                    "value": "010102",
                    "key": "长沙职位2"
                }]
            }, {
                "value": "0201",
                "key": "长沙单位2",
                "children": [{
                    "value": "010201",
                    "key": "长沙职位3"
                }, {
                    "value": "010202",
                    "key": "长沙职位4"
                }]
            }]
        }];

		
		angular.fromJson('sdfsdf');    
    }])
    </script>
</body>

</html>
